package com.blueocean_health.care.management.domain.dto;

import java.math.BigDecimal;

public class HomeCalcRespInfo {

    private String time;
    private int patientCount;           //患者个数
    private int nurseCount;             //上工人次
    private Double receiveAmount;       //应收金额
    private Double paymentAmount;       //收款金额
    private Double commissionAmount;    //提成
    private String grossProfitMargin;   //毛利率

    public void calc(){
        if(receiveAmount == null || commissionAmount == null || receiveAmount == 0){
            this.grossProfitMargin = "0.00";
            return ;
        }
        double v = (receiveAmount - commissionAmount) / receiveAmount * 100;
        this.grossProfitMargin = new BigDecimal(v).setScale(2, BigDecimal.ROUND_HALF_DOWN).toString();
    }


    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public int getPatientCount() {
        return patientCount;
    }

    public void setPatientCount(int patientCount) {
        this.patientCount = patientCount;
    }

    public int getNurseCount() {
        return nurseCount;
    }

    public void setNurseCount(int nurseCount) {
        this.nurseCount = nurseCount;
    }

    public Double getReceiveAmount() {
        return receiveAmount == null ? 0 : receiveAmount;
    }

    public void setReceiveAmount(Double receiveAmount) {
        this.receiveAmount = receiveAmount;
    }

    public Double getPaymentAmount() {
        return paymentAmount == null ? 0 : paymentAmount;
    }

    public void setPaymentAmount(Double paymentAmount) {
        this.paymentAmount = paymentAmount;
    }

    public Double getCommissionAmount() {
        return commissionAmount == null ? 0 : commissionAmount;
    }

    public void setCommissionAmount(Double commissionAmount) {
        this.commissionAmount = commissionAmount;
    }

    public String getGrossProfitMargin() {
        return grossProfitMargin;
    }

    public void setGrossProfitMargin(String grossProfitMargin) {
        this.grossProfitMargin = grossProfitMargin;
    }

    @Override
    public String toString() {
        return "HomeCalcRespInfo{" +
                "time='" + time + '\'' +
                ", patientCount=" + patientCount +
                ", nurseCount=" + nurseCount +
                ", receiveAmount='" + receiveAmount + '\'' +
                ", paymentAmount='" + paymentAmount + '\'' +
                ", commissionAmount='" + commissionAmount + '\'' +
                ", grossProfitMargin='" + grossProfitMargin + '\'' +
                '}';
    }
}
